home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / recirc.nnc < prev    next >
Text File  |  1993-08-23  |  3KB  |  92 lines

  1. csv3.0        !file format is Control Strategy Version 3.0
  2. ! Nov-88  (recirc.nnc)  Recirculation Network
  3. !************************************************************************
  4. !*                                    *
  5. !*    Recirculation Network Control Strategy                *
  6. !*                                    *
  7. !*    This control strategy assumes the following layers,        *
  8. !*    geometrically positioned from bottom to top of the screen:    *
  9. !*                                    *
  10. !*    layer 0:    Input Buffer                    *
  11. !*    layer 1:    Visible Layer ( same size as input buffer )    *
  12. !*    layer 2:    Hidden Layer                    *
  13. !*    layer 3:    Output Buffer ( same size as input buffer )    *
  14. !*                                    *
  15. !************************************************************************
  16. !
  17. !MASK     label    op-code    operands    comment
  18. L_saR_sa    trace    aux3        !  1 set trace option to aux3
  19. Li_aRi_a    cset    recall,1    !  2 Initialize recall count
  20. !
  21. ! Get input
  22. !
  23. L_s_R_s_    ccmp    recall,1    !  3 For step check if 1st time through
  24. L_s_R_s_    bne    @step2        !  4 go to step 2
  25. L_saR_sa    lset    in        !  5 input layer
  26. L___R_sa    io    read        !  6 get input data (recall)
  27. L_saR___    io    lrnin        !  7 get input data (learn)
  28. !
  29. ! Inject input
  30. !
  31. L_saR_sa     lset    in,1            !  8 Visible layer
  32. L_saR_sa     math    set|w=i|output|e=w|fire    !  9 do math, save output
  33. L_saR_sa    cadd    recall,1        ! 10 recall = 2
  34. L_s_R_s_    br    @eos            ! 11 end of step
  35. !
  36. ! Pass to Hidden layer
  37. !
  38. L_s_R_s_ @step2    ccmp    recall,2        ! 12 see if at step 2
  39. L_s_R_s_    bne    @step3            ! 13 if not, goto step 3
  40. L_saR_sa    lset    out,-1            ! 14 hidden layer
  41. L_saR___    math    sum|lnoise|tran|output|e=w|fire ! 15
  42. L___R_sa     math    sum|rnoise|tran|output|e=w ! 16
  43. L_saR_sa    io    wrstep            ! 17 write to userio
  44. L_saR_sa    cadd    recall,1        ! 18 recall = 3
  45. L_s_R_s_    br    @eos            ! 19 end of step
  46. !
  47. ! Recirculate to visible layer
  48. !
  49. L_s_R_s_ @step3    ccmp    recall,3        ! 20 see if at step 3
  50. L_s_R_s_    bne    @step4            ! 21 if not, goto step 4
  51. L_saR_sa     lset    in,1            ! 22 Visible layer
  52. ! Do math, output non-regressed value, calculate regressed value
  53. L_saR__     math    sum|lnoise|tran|output|e-=w|regress|fire !23
  54. L___R_s_    math    sum|rnoise|tran|output|e-=w|regress|fire !24
  55. L___R__a    math    sum|rnoise|tran|output|e-=w|fire     !24 CCK
  56. !
  57. ! Feed visible info to output layer
  58. !
  59. L_saR_sa     lset    out            ! 26 output layer
  60. L_saR_sa    math    sum|tran|output|fire    ! 27 do math
  61. !
  62. ! Output regressed value
  63. !
  64. L_saR_sa    lset    in,1            ! 28 Visible layer
  65. L_saR_sa    math    ce=e|output|fire    ! 29 Output regressed value
  66. L_saR_sa    io    wrstep            ! 30 write to userio
  67. L_saR_sa    cadd    recall,1        ! 31 recall = 4
  68. L_s_R_s_    br    @eos            ! 32 end of step
  69. !
  70. ! feed to hidden layer again ("learn" and "recall step" only)
  71. !
  72. L_s_R_s_ @step4    ccmp    recall,4        ! 33 see if at step 4
  73. L_s_R_s_    bne    @learn            ! 34 if not, do learn
  74. L_saR_s_     lset    out,-1            ! 35 Output buffer
  75. L_saR_s_    math    sum|lnoise|tran|output|e-=w|fire !36
  76. L_saR_s_    math    ce=e            ! 37
  77. L_saR_sa    cadd    recall,1        ! 38 recall = 5
  78. L_s_R_s_ @eos    eos                ! 39 End of step
  79. !
  80. ! learn
  81. !
  82. L_saR___ @learn    lset    in,1            ! 40 Visible layer
  83. L_saR___    math    learn|fire        ! 41 Learn
  84. L_saR___     lset    out,-1            ! 42 hidden layer
  85. L_saR___    math    learn|fire        ! 43 Learn
  86. !
  87. ! Write output to User I/O
  88. L_saR_sa    lset    out            ! 44 Output layer
  89. L___R_sa    io    write            ! 45 Recall output
  90. L_saR___    io    lrnrslt            ! 46 Learn output
  91. !LisaRisa    trace    0            ! 47 turn off any trace function
  92.